import { createApp } from "vue";
import App from "./App.vue";
// reset style sheet
import "@/styles/reset.scss";
// CSS common style sheet
import "@/styles/common.scss";
// iconfont css
import "@/assets/iconfont/iconfont.scss";
import "@/assets/iconfont/iconfont_custom.scss";
import "@/assets/iconfont/iconfont_custom1.scss";
// font css
import "@/assets/fonts/font.scss";
// element css
import "element-plus/dist/index.css";
// element dark css
import "element-plus/theme-chalk/dark/css-vars.css";
// custom element dark css
import "@/styles/element-dark.scss";
// custom element css
import "@/styles/element.scss";
// svg icons
import "virtual:svg-icons-register";
// element plus
import ElementPlus from "element-plus";
// element icons
import * as Icons from "@element-plus/icons-vue";

// arco
// import ArcoVue from "@arco-design/web-vue";
// import "@arco-design/web-vue/dist/arco.css";

// AntDesign
import Antd from "ant-design-vue";
import "ant-design-vue/dist/reset.css";

// custom directives
import directives from "@/directives/index";
// vue Router
import router from "@/routers";
// vue i18n
import I18n from "@/languages/index";
// pinia store
import pinia from "@/stores";
// errorHandler
// import errorHandler from "@/utils/errorHandler";
// vant
import Vant from "vant";
// import { Loading } from "vant";

// 引入vant组件样式
import "vant/lib/index.css";

// VConsole
// import VConsole from "vconsole";

import { isPC, currentEnv } from "./utils/sys";

// Menus
import Menus from "vue3-menus";

import "@/assets/updatecss.scss";

// let vConsole;
if (!isPC() && currentEnv() == "development") {
  // vConsole = new VConsole();
}

const app = createApp(App);

// app.config.errorHandler = errorHandler;

// register the element Icons component
Object.keys(Icons).forEach(key => {
  app.component(key, Icons[key as keyof typeof Icons]);
});

app.use(ElementPlus);
app.use(Antd);
app.use(Vant);
app.use(directives);
app.use(router);
app.use(I18n);
app.use(pinia);
app.use(Menus);

if (!isPC()) {
  // console.log(vConsole);
  // console.log(VConsole);
  // console.log(vConsole);
}

app.mount("#app");
